package com.itheima.mapper.client;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.domian.Orders;
import com.itheima.domian.vo.OrderVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @Author 12441
 * @Date 2022/8/11 15:11
 * @Version 1.0
 */
@Mapper
public interface OrderMapper extends BaseMapper<Orders> {


    @Select("SELECT orders.id as id, order_time,status, orders.amount,\n" +
            "      name, order_details.number  FROM orders join order_details on orders.number = order_details.order_id")
    IPage<OrderVo> findByPage(Page<OrderVo> page, QueryWrapper<OrderVo> queryWrapper);
}
